<% #endcoding:utf-8%>
<% uid =  params[:id].nil? ? session[:user_id] : params[:id] %>
<% @user = params[:id].nil? ? User.find(session[:user_id]) : User.find(params[:id])%>
<%if @user.user_type #企业 %>
    <%=render partial: "factoryshow"%>
<%else%>
    <%=render partial: "counselorshow"%>
<%end%>
<div class="panel">
  <ul class="list-group user-menu">
    <%if current_user?(uid)%>
    <li class="list-group-item">
      <span class="badge"><%=@user.messages.count%></span>
      <%=link_to '消息','/mymessages'%>
    </li>
    <%end%>
    <li class="list-group-item">
      <%=link_to '我的名片','/myinfo/'+uid.to_s,class:'list-link'%>
    </li>

    <%if isfactory?@user%>
        <li class="list-group-item">
          <%=link_to '我的需求','/mydemand/'+uid.to_s,class:'list-link'%>
        </li>
        <li class="list-group-item">
          <%=link_to '我的提问','/myquestions/'+uid.to_s,class:'list-link'%>
        </li>
        <%else%>
        <li class="list-group-item">
          <%=link_to '我的投标','/myoffers/'+uid.to_s,class:'list-link'%>
        </li>
        <li class="list-group-item">
          <%=link_to '我的回答','/myanswers/'+uid.to_s,class:'list-link'%>
        </li>
    <%end%>
  </ul>
</div>